﻿<Window xmlns:my="clr-namespace:Wilke.Interactive.Drone.PlayGround"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:media3D="clr-namespace:System.Windows.Media.Media3D;assembly=PresentationCore"
        xmlns:media="clr-namespace:System.Windows.Media;assembly=PresentationCore"
        xmlns:userControls="clr-namespace:Wilke.Interactive.Drone.PlayGround.UserControls"        
        x:Class="Wilke.Interactive.Drone.PlayGround.MainWindow"
        x:Name="mainWindow"
        Title="MainWindow" mc:Ignorable="d"
        Height="1151" 
        Width="1853" PreviewKeyDown="Window_PreviewKeyDown" Background="#FF202020" SizeChanged="Window_SizeChanged" Loaded="Window_Loaded" Closing="mainWindow_Closing" 
        xmlns:thriple="http://thriple.codeplex.com/">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ResourceDictionary.xaml"/>
                <ResourceDictionary Source="/Resources/Dictionaries/BlackGlossy.xaml"/>
                <ResourceDictionary Source="/Resources/Dictionaries/ImageCombo.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <Style x:Key="ButtonFocusVisual">
                <Setter Property="Control.Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
                <GradientStop Color="#F3F3F3" Offset="0"/>
                <GradientStop Color="#EBEBEB" Offset="0.5"/>
                <GradientStop Color="#DDDDDD" Offset="0.5"/>
                <GradientStop Color="#CDCDCD" Offset="1"/>
            </LinearGradientBrush>
            <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
            <ObjectDataProvider x:Key="DropDownProvider" 
                                ObjectType="{x:Type my:InputProviderListItems}" 
                                MethodName="GetItems" />
            <SolidColorBrush x:Key="StatusGreen" Color="#FF005A00" />
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <userControls:ButtonHeader x:Name="buttonHeader" 
           Height="138" 
           VerticalAlignment="Top" SegmentClicked="buttonHeader_SegmentClicked" />
        <Grid x:Name="playGround"
                Margin="0 138 0 5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="8px"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Border x:Name="leftColumn"
                    Background="{StaticResource DiagramGradientBrush}"
                    BorderBrush="Silver" 
                    BorderThickness="2 0 2 2"         
                    Margin="7,0,0,7"
                    Grid.Column="0">
                <Grid>
                    <Border BorderBrush="Silver" 
                            BorderThickness="1" 
                            Height="253" 
                            Margin="6,23,8,0" 
                            Name="borderStatusInfo" 
                            Style="{StaticResource StylishBorder}" 
                            VerticalAlignment="Top" 
                            Padding="6"
                            RenderTransformOrigin="0.638,0.695">
                        <ListBox Name="listBox1" BorderBrush="{x:Null}" Background="{x:Null}" Foreground="White" FontSize="16" />
                    </Border>
                    <Border BorderBrush="Silver" 
                            BorderThickness="1" 
                            Margin="7,283,6,7" 
                            Name="borderVideoInfo" 
                            Style="{StaticResource StylishBorder}" 
                            Padding="1">
                        <Border.RenderTransform>
                            <ScaleTransform x:Name="videoScale"/>
                        </Border.RenderTransform>
                        <Grid>                            
                            <Grid.OpacityMask>
                                <VisualBrush Visual="{Binding ElementName=mask}"/>
                            </Grid.OpacityMask>
                            <Border Name="mask" Background="White" CornerRadius="16"/>
                            <Image Name="imageDroneCamera" Stretch="Fill" Source="/Resources/Images/Default.png"/>
                            <Canvas Name="drawingSurface"></Canvas>
                        </Grid>
                    </Border>
                </Grid>
            </Border>
            <Border x:Name="rightColumn"
                    Background="{StaticResource DiagramGradientBrush}"
                    BorderBrush="Silver" 
                    BorderThickness="2 0 2 2"         
                    Margin="3,0,7,7"
                    Grid.Column="2">
                <Grid>
                <Border BorderBrush="Silver" BorderThickness="1" Height="512" Margin="6,23,8,0" Name="borderNavigation" Style="{StaticResource StylishBorder}" VerticalAlignment="Top" Grid.RowSpan="2" RenderTransformOrigin="0.638,0.695">
                    <Grid Name="canvas1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width=".4*"/>
                            <ColumnDefinition Width=".6*"/>
                        </Grid.ColumnDefinitions>
                        <TabControl Name="tabControlSwitch" TabStripPlacement="Bottom" UseLayoutRounding="False" Background="{x:Null}" BorderBrush="{x:Null}">
                            <TabItem Header="Joystick" Name="tabJoystick" Height="0">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height=".3*"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <Button Height="85" HorizontalAlignment="Left" Name="buttonSwitch1" VerticalAlignment="Top" Width="85" Style="{StaticResource BlackGlossyButton}" Click="buttonSwitch_Click" Margin="5,5,0,0">
                                            <Image Source="/Wilke.Interactive.Drone.PlayGround;component/Resources/Images/Switch.png" Height="72" Width="74" />
                                        </Button>
                                    <Viewbox Margin="7.8,10.974,6,61.133" Name="viewbox2" Grid.Row="1">
                                        <my:JoystickBase Height="160" x:Name="joystickBase" Width="160" />
                                    </Viewbox>
                                </Grid>
                            </TabItem>
                            <TabItem Header="Sliders" Name="tabItemSliders" Height="0">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height=".3*"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                        <Button Height="85" Width="85" HorizontalAlignment="Left" Margin="5,5,0,0" Name="buttonSwitch2" VerticalAlignment="Top"  Style="{StaticResource BlackGlossyButton}" Click="buttonSwitch_Click">
                                            <Image Source="/Wilke.Interactive.Drone.PlayGround;component/Resources/Images/Switch.png" Height="72" Width="74" />
                                        </Button>
                                    <my:Slider Grid.Row="1" HorizontalAlignment="Left" Margin="5,36,0,0" x:Name="sliderHeight" VerticalAlignment="Top" Height="342.769" Width="97.5" />
                                        <my:Slider Height="341" HorizontalAlignment="Left" Margin="149.05,36.769,0,0" x:Name="sliderYaw" VerticalAlignment="Top" Width="97.5" Grid.Row="1" />
                                        <TextBlock FontSize="22" Foreground="White" Height="39" HorizontalAlignment="Left" Margin="10,111.231,0,0" Name="textBlock3" Text="Height" VerticalAlignment="Top" Width="96.5" TextAlignment="Center" Grid.RowSpan="2" />
                                        <TextBlock FontSize="22" Foreground="White" Height="39" HorizontalAlignment="Left" Margin="151.9,111.231,0,0" Name="textBlock4" Text="Yaw" TextAlignment="Center" VerticalAlignment="Top" Width="96.5" Grid.RowSpan="2" />
                                    </Grid>
                            </TabItem>
                        </TabControl>
                        <Viewbox Grid.Column="1" Name="viewboxRadar" Stretch="Fill" Margin="6,11,6,0" Height="304" VerticalAlignment="Top">
                            <Border>
                                <my:Radar x:Name="radarScreen"/>
                            </Border>
                        </Viewbox>
                        <Button Content="Button" Height="63" HorizontalAlignment="Left" Margin="10,529,0,0" Name="button2" VerticalAlignment="Top" Width="69" Style="{StaticResource BlackGlossyButton}" />
                        </Grid>
                </Border>
                <Border BorderBrush="Silver" 
                            BorderThickness="1" 
                            Margin="7,545,6,7" 
                            Name="borderControls" 
                            Style="{StaticResource StylishBorder}" 
                            Padding="1">
                        <Grid>
                            <TextBlock Height="39" HorizontalAlignment="Left" Margin="145,99,0,0" Name="textBlock1" Text="Drone Communication Status" VerticalAlignment="Top" Width="320" FontSize="22" Foreground="White" />
                            <TextBlock FontSize="22" Foreground="White" Height="39" HorizontalAlignment="Left" Margin="145,175,0,0" Name="textBlock2" Text="Recording" VerticalAlignment="Top" Width="190" />
                            <my:StatusButton HorizontalAlignment="Left" Margin="32,88,0,0" x:Name="buttonDroneNavigationStatus" VerticalAlignment="Top" Height="60" Width="60" Background="{x:Null}" InnerButtonColor="DimGray" />
                            <my:StatusButton Background="{x:Null}" Height="60" HorizontalAlignment="Left" InnerButtonColor="DimGray" Margin="33,166,0,0" x:Name="buttonRecordingStatus" VerticalAlignment="Top" Width="60" />
                            <Image Height="72" HorizontalAlignment="Left" Margin="11,6,0,0" Name="imageBatteryLevel" Stretch="Fill" VerticalAlignment="Top" Width="97" Source="/Wilke.Interactive.Drone.PlayGround;component/Resources/Images/BatteryDisabled.png" />
                            <TextBlock FontSize="22" Foreground="White" Height="39" HorizontalAlignment="Left" Margin="145,26,0,0" Name="textBlock5" Text="Drone Battery Level" VerticalAlignment="Top" Width="190" />
                        </Grid>
                    </Border>
                </Grid>
            </Border>
        </Grid>
        <Grid Name="buttonStrip" Height="81" Margin="0,85,0,0"  VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width=".47*" />
                <ColumnDefinition Width=".06*" />
                <ColumnDefinition Width=".47*" />
            </Grid.ColumnDefinitions>
            <Button Content="Take Off" Foreground="White" Name="buttonTakeOff" Style="{StaticResource BlackGlossyButton}" Grid.Column="2" Margin="244,6,0,15" HorizontalAlignment="Left" Width="85" Click="buttonTakeOff_Click" FontSize="16" Height="60" />
            <Button Content="Flat Trim" Foreground="White" HorizontalAlignment="Left" Margin="336,6,0,15" Name="button1" Style="{StaticResource BlackGlossyButton}" Width="85" Grid.Column="2" FontSize="16" Height="60" />
            <Button Content="Reset" Foreground="White" HorizontalAlignment="Left" Margin="428,6,0,15" Name="buttonResetDrone" Style="{StaticResource BlackGlossyButton}" Width="85" Grid.Column="2" FontSize="16" Height="60" PreviewMouseDown="buttonResetDrone_PreviewMouseDown" PreviewMouseUp="buttonResetDrone_PreviewMouseUp" PreviewStylusDown="buttonResetDrone_PreviewStylusDown" PreviewStylusUp="buttonResetDrone_PreviewStylusUp" PreviewTouchDown="buttonResetDrone_PreviewTouchDown" PreviewTouchUp="buttonResetDrone_PreviewTouchUp" />
            <ComboBox x:Name="comboboxInputProvider" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource DropDownProvider}}" Style="{StaticResource ImageComboBox}" MaxWidth="350" MaxHeight="100" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="28,6,0,0" Width="210" Height="60" FontSize="16" Foreground="White" Grid.Column="2" SelectionChanged="comboboxInputProvider_SelectionChanged" />
            <ToggleButton Height="60" Name="buttonRecordVideo" Style="{StaticResource BlackGlossyToggleButton}" Margin="0,6,214,0" VerticalAlignment="Top" Click="buttonRecordVideo_Click" Grid.Column="2" HorizontalAlignment="Right" Width="60">
                <Image Source="/Resources/Images/Video.png" Width="40" Height="40"></Image>
            </ToggleButton>
            <Button Height="60" Margin="0,6,147,0" Name="buttonTakePicture" VerticalAlignment="Top" Style="{StaticResource BlackGlossyButton}" Click="buttonTakePicture_Click" Grid.Column="2" HorizontalAlignment="Right" Width="60">
                <Image Height="40" Source="/Resources/Images/Camera.png" Width="40" />
            </Button>
            <Button Height="60" HorizontalAlignment="Right" Margin="0,6,80,0" Name="buttonPlayLed" Style="{StaticResource BlackGlossyButton}" VerticalAlignment="Top" Width="60" Grid.Column="2" Click="buttonPlayLed_Click">
                <Image Height="40" Source="/Wilke.Interactive.Drone.PlayGround;component/Resources/Images/Led.png" Width="40" />
            </Button>
            <Button Height="60" HorizontalAlignment="Right" Margin="0,6,14,0" Name="buttonSwitchVideoChannel" Style="{StaticResource BlackGlossyButton}" VerticalAlignment="Top" Width="60" Grid.Column="2" Click="buttonSwitchVideoChannel_Click">
                <Image Height="40" Source="/Wilke.Interactive.Drone.PlayGround;component/Resources/Images/SwitchVideoChannel.png" Width="40" />
            </Button>
            <Button Height="60" Name="buttonDesignPath" Style="{StaticResource BlackGlossyButton}" VerticalAlignment="Top" Margin="23,6,0,0" Click="buttonDesignPath_Click" HorizontalAlignment="Left" Width="60">
                <Image Height="65" Source="/Wilke.Interactive.Drone.PlayGround;component/Resources/Images/Path.png" Width="52" />
            </Button>
            <ToggleButton Height="60" HorizontalAlignment="Left" Margin="90,6,0,0" Name="buttonFollowMe" Style="{StaticResource BlackGlossyToggleButton}" VerticalAlignment="Top" Width="60" Click="buttonFollowMe_Click">
                <Image Height="40" Source="/Resources/Images/Track.png" Width="40" />
            </ToggleButton>
        </Grid>
    </Grid>
</Window>
